/**
 * [commInfo description] bean的公共fields  通过 mongoose.plugin 方法添加到表中
 * @param  {[mongoose.Schema]} schema
 * @param  {[object]} options
 * @return {[type]}
 */
//import 

const CommInfo = (schema, options) => {
	schema.add({ crUser: String,
		editor: String,
		crTime: {type:Date, default: Date.now},
		edTime: {type:Date,set:function(){return new Date;}, default: Date.now}
	});
}

const dbPrefix = global.dbPrefix;

const CommConf = {
	tableName: function(name) {
		return  `#{dbPrefix}#{name};` 
	}
};

export default {CommInfo, CommConf};